﻿@{
    ViewBag.Title = "来料";
    Layout = "~/Views/Shared/FrameWorkList.cshtml";
}

<body> 
    <div id="grid111">
        <table id="gridList1"></table>
        <div id="gridPager1"></div>
    </div>
    <div id="grid222">
        <table id="gridList2"></table>
        <div id="gridPager2"></div>
    </div>
</body>


<script>
    var rowData = {};
    var index = -1;
    $(function () {
        initControl();
        gridList1();
    });
    function initControl() {
        $('select').bindSelect();
        gridList1();
    } 
    function gridList1() {
        $("#grid111").show();
        $("#grid222").hide();
        var $gridList = $("#gridList1");
        $gridList.dataGridForJson({
            //url: "/VBaseData/V_CPK_45_HZ_StoCPKListAcco_Mid/GetParameterGridJson",//入库主界面显示
            //height: $(window).height() - 130,
            //colModel: [
            //        { label: "id", name: "FDocuListID", width: 120, align: 'center', hidden: true },
            //        { label: '单据编号', name: 'FDocuNO', width: 150, align: 'center' },
            //        //{ label: '单据编号', name: 'FDouBarCode', width: 120, align: 'center' },
            //        { label: '单据日期', name: 'FCurDate', width: 80, align: 'center' },
            //        { label: "来料单位", name: "FProCompanyNO", width: 80, align: 'left' },
            //        { label: "来料单位名称", name: "FProCompanyName", width: 120, align: 'left' },
            //        { label: '零件编号', name: 'FProductionNO', width: 120, align: 'left' },
            //        { label: '零件名称', name: 'FProductionName', width: 140, align: 'left' },
            //                            { label: '开票数量', name: 'FQuantity_KP', width: 60, align: 'right' },
            //        { label: '实际数量', name: 'FQuantity', width: 80, align: 'right' },


            url: "/VBaseData/V_CPK_45_HZ_StoCPKListAcco_Mid/GetParameterGridJson",
                height: $(window).height() - 170,
                colModel: [
                { label: "来料单位", name: "UseUnit", width: 100, align: 'center' },
                { label: "来料单位名称", name: "FDouBarCode", width: 130, align: 'center' },
                { label: '入库日期', name: 'FCurDate', width: 80, align: 'center' },
                { label: '零部件号', name: 'FProductionNO', width: 80, align: 'center' },
                { label: '零件名称', name: 'FProductionName ', width: 100, align: 'center' },

 
            ],
            pager: "#gridPager1",
            sortname: 'F_DepartmentId asc,F_CreatorTime desc',
            viewrecords: true,
            multiselect: true,
            onSelectRow: function (rowId) {
                rowData = $gridList.jqGrid('getRowData', rowId);
                index = rowId;
                $.each(rowData, function (key, value) {
                    $("#txt" + key).val(value);
                });
            }
        });
    }
</script>

